package com.flute.framework.index.fieldbuilder;

import java.util.ArrayList;
import java.util.List;

public abstract class AbstractFieldBuilder implements IFieldBuilder {
	protected String docField;
	protected String dataField;

	@Override
	public void setDataFields(List<String> dataFields) {
		if (dataFields.size() == 0) {
			this.dataField = dataFields.get(0);
		}
	}

	@Override
	public void setDataField(String dataField) {
		this.dataField = dataField;
	}

	public List<String> getDataFields() {
		List<String> list = new ArrayList<String>();
		if (dataField != null) {
			list.add(dataField);
		}

		return list;
	}

	public String getDataField() {
		return dataField;
	}

	public String getDocField() {
		return docField;
	}

	public void setDocField(String docField) {
		this.docField = docField;
	}
}
